package com.traitswu.simple.demo.service;

import com.traitswu.simple.demo.dao.UserMapper;
import com.traitswu.simple.demo.model.User;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;


@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public long save(User user) {
        return userMapper.save(user);
    }

    @Override
    public List<User> list() {
        return userMapper.list();
    }

    @Override
    public User get(long id) {
        return userMapper.get(id);
    }

    @Override
    public void update(User user) {
        userMapper.update(user);
    }


}
